//
//  RootTabBarViewController.m
//  HeartOfMeet
//
//  Created by qianfeng on 16/3/30.
//  Copyright © 2016年 千云锋. All rights reserved.
//

#import "RootTabBarViewController.h"
#import "BaseViewController.h"
#import "LeaderViewController.h"
#import "DiscoverViewController.h"
#import "SpeakViewController.h"
@interface RootTabBarViewController ()

@end

@implementation RootTabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self viewControllerSetting];
    // Do any additional setup after loading the view.
}

- (void)viewControllerSetting{
    self.tabBar.translucent = NO;
    self.tabBar.barTintColor = [UIColor blackColor];
    self.tabBar.tintColor = [UIColor whiteColor];
    
    LeaderViewController *leaderVC = [[LeaderViewController alloc] init];
    leaderVC.tabBarItem.image = [[UIImage imageNamed: @"leader"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    leaderVC.tabBarItem.selectedImage = [[UIImage imageNamed: @"leader-act"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UINavigationController *leaderNav = [[UINavigationController alloc] initWithRootViewController:leaderVC];
    leaderNav.tabBarItem.title = @"首页";
    leaderNav.tabBarItem.imageInsets = UIEdgeInsetsMake(5, -40, -5, 40);
    
    DiscoverViewController *disVC = [[DiscoverViewController alloc] init];
    disVC.tabBarItem.image = [[UIImage imageNamed: @"nav_find"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    disVC.tabBarItem.selectedImage = [[UIImage imageNamed: @"nav_find_act"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UINavigationController *disNav = [[UINavigationController alloc] initWithRootViewController:disVC];
    disNav.tabBarItem.title = @"发现";
    disNav.tabBarItem.imageInsets = UIEdgeInsetsMake(5, -40, -5, 40);
    
    SpeakViewController *speakVC = [[SpeakViewController alloc] init];
    speakVC.tabBarItem.image = [[UIImage imageNamed: @"nav_my"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    speakVC.tabBarItem.selectedImage = [[UIImage imageNamed: @"nav_my_act"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UINavigationController *speakNav = [[UINavigationController alloc] initWithRootViewController:speakVC];
    speakNav.tabBarItem.title = @"主播";
    speakNav.tabBarItem.imageInsets = UIEdgeInsetsMake(5, -40, -5, 40);
    
    [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:14],NSFontAttributeName, nil] forState:UIControlStateNormal];
    [[UITabBarItem appearance] setTitlePositionAdjustment:UIOffsetMake(15, -15.0)];

    
    NSArray *viewControllers = @[leaderNav,disNav,speakNav];
    
    self.viewControllers = viewControllers;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
